<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>class AboutYou::SDK::Criteria::ProductSearchCriteria - RDoc Documentation</title>

<link href="../../../fonts.css" rel="stylesheet">
<link href="../../../rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../../";
</script>

<script src="../../../js/jquery.js"></script>
<script src="../../../js/navigation.js"></script>
<script src="../../../js/search_index.js"></script>
<script src="../../../js/search.js"></script>
<script src="../../../js/searcher.js"></script>
<script src="../../../js/darkfish.js"></script>


<body id="top" role="document" class="class">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../../../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../../../table_of_contents.html#pages">Pages</a>
    <a href="../../../table_of_contents.html#classes">Classes</a>
    <a href="../../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="class-metadata">
    
    <div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  
  <p class="link">Object
  
</div>

    
    
    <!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    
    <li ><a href="#method-c-new">::new</a>
    
    <li ><a href="#method-i-boost_products">#boost_products</a>
    
    <li ><a href="#method-i-check_facet_limit">#check_facet_limit</a>
    
    <li ><a href="#method-i-filter_by">#filter_by</a>
    
    <li ><a href="#method-i-filter_by_category_ids">#filter_by_category_ids</a>
    
    <li ><a href="#method-i-filter_by_facet_group">#filter_by_facet_group</a>
    
    <li ><a href="#method-i-filter_by_facet_group_set">#filter_by_facet_group_set</a>
    
    <li ><a href="#method-i-filter_by_facet_ids">#filter_by_facet_ids</a>
    
    <li ><a href="#method-i-filter_by_price_range">#filter_by_price_range</a>
    
    <li ><a href="#method-i-filter_by_sale">#filter_by_sale</a>
    
    <li ><a href="#method-i-filter_by_searchword">#filter_by_searchword</a>
    
    <li ><a href="#method-i-requires_categories">#requires_categories</a>
    
    <li ><a href="#method-i-requires_facets">#requires_facets</a>
    
    <li ><a href="#method-i-select_all_facets">#select_all_facets</a>
    
    <li ><a href="#method-i-select_categories">#select_categories</a>
    
    <li ><a href="#method-i-select_facets_by_group_id">#select_facets_by_group_id</a>
    
    <li ><a href="#method-i-select_price_ranges">#select_price_ranges</a>
    
    <li ><a href="#method-i-select_product_fields">#select_product_fields</a>
    
    <li ><a href="#method-i-select_sales">#select_sales</a>
    
    <li ><a href="#method-i-set_limit">#set_limit</a>
    
    <li ><a href="#method-i-sort_by">#sort_by</a>
    
    <li ><a href="#method-i-to_array">#to_array</a>
    
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-labelledby="class-AboutYou::SDK::Criteria::ProductSearchCriteria">
  <h1 id="class-AboutYou::SDK::Criteria::ProductSearchCriteria" class="class">
    class AboutYou::SDK::Criteria::ProductSearchCriteria
  </h1>

  <section class="description">
    
<p>This class is used as the criteria for a product search Its instance is
meant to be passed to the fetchProducrSearch method To add a specific
criteria simply call the method on the instance</p>
<dl class="rdoc-list note-list"><dt>author
<dd>
<p>Collins GmbH &amp; Co KG</p>
</dd></dl>

  </section>

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    
    <section class="constants-list">
      <header>
        <h3>Constants</h3>
      </header>
      <dl>
      
        <dt id="FILTER_ATTRIBUTES">FILTER_ATTRIBUTES
        
        <dd><p>api-call-name for filtering the facets</p>
        
      
        <dt id="FILTER_CATEGORY_IDS">FILTER_CATEGORY_IDS
        
        <dd><p>api-call-name for filtering the categories</p>
        
      
        <dt id="FILTER_PRICE">FILTER_PRICE
        
        <dd><p>api-call-name for filtering the prices</p>
        
      
        <dt id="FILTER_SALE">FILTER_SALE
        
        <dd><p>api-call-name for filtering the sale</p>
        
      
        <dt id="FILTER_SEARCHWORD">FILTER_SEARCHWORD
        
        <dd><p>api-call-name for filtering the searchword</p>
        
      
        <dt id="SORT_ASC">SORT_ASC
        
        <dd><p>api-call-name for sorting ascending</p>
        
      
        <dt id="SORT_CREATED">SORT_CREATED
        
        <dd><p>Sort-argument passed to api for creation date</p>
        
      
        <dt id="SORT_DESC">SORT_DESC
        
        <dd><p>api-call-name for sorting descending</p>
        
      
        <dt id="SORT_MOST_VIEWED">SORT_MOST_VIEWED
        
        <dd><p>Sort-argument passed to api for most viewed</p>
        
      
        <dt id="SORT_PRICE">SORT_PRICE
        
        <dd><p>Sort-argument passed to api for price</p>
        
      
        <dt id="SORT_RELEVANCE">SORT_RELEVANCE
        
        <dd><p>Sort-argument passed to api for relevance</p>
        
      
        <dt id="SORT_TYPE_CREATED">SORT_TYPE_CREATED
        
        <dd><p>api-call-name for sorting after created_date</p>
        
      
        <dt id="SORT_TYPE_MOST_VIEWED">SORT_TYPE_MOST_VIEWED
        
        <dd><p>api-call-name for sorting after most_viewed</p>
        
      
        <dt id="SORT_TYPE_PRICE">SORT_TYPE_PRICE
        
        <dd><p>api-call-name for sorting after price</p>
        
      
        <dt id="SORT_TYPE_RELEVANCE">SORT_TYPE_RELEVANCE
        
        <dd><p>api-call-name for sorting after relevance</p>
        
      
        <dt id="SORT_TYPE_UPDATED">SORT_TYPE_UPDATED
        
        <dd><p>api-call-name for sorting after updated_date</p>
        
      
        <dt id="SORT_UPDATED">SORT_UPDATED
        
        <dd><p>Sort-argument passed to api for last updated</p>
        
      
      </dl>
    </section>
    

    
    <section class="attribute-method-details" class="method-section">
      <header>
        <h3>Attributes</h3>
      </header>

      
      <div id="attribute-i-filter" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">filter</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>the filter applied to the api-call</p>
        
        </div>
      </div>
      
      <div id="attribute-i-result" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">result</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>a specification of the result which should be fetched from api</p>
        
        </div>
      </div>
      
      <div id="attribute-i-session_id" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">session_id</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>the session id of a user</p>
        
        </div>
      </div>
      
    </section>
    

    
     <section id="public-class-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Class Methods</h3>
       </header>

    
      <div id="method-c-new" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">new</span><span
            class="method-args">(session_id)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>Constructor for <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>session_id</code> -&gt; the session is of an user</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 64</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">session_id</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">filter</span>    = {}
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">session_id</span> = <span class="ruby-identifier">session_id</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">result</span>    = {}
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Instance Methods</h3>
       </header>

    
      <div id="method-i-boost_products" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">boost_products</span><span
            class="method-args">(ids)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method lets the api return products. It will prefer to return products
which are given by <code>ids</code></p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>ids</code> -&gt; the products which should be boosted or the ids of
them</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="boost_products-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 401</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">boost_products</span>(<span class="ruby-identifier">ids</span>)
  <span class="ruby-identifier">mapped_ids</span> = []
  <span class="ruby-identifier">ids</span> = <span class="ruby-identifier">ids</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span>
    <span class="ruby-operator">|</span><span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mapped_ids</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">val</span>.<span class="ruby-identifier">id</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">Product</span>)
    <span class="ruby-identifier">mapped_ids</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">val</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">mapped_ids</span> = <span class="ruby-identifier">mapped_ids</span>.<span class="ruby-identifier">uniq</span>
  <span class="ruby-identifier">result</span>[<span class="ruby-string">'boosts'</span>] = <span class="ruby-identifier">ids</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-check_facet_limit" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">check_facet_limit</span><span
            class="method-args">(limit)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method checks whether a given facet limit is valid or not</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>limit</code> -&gt; limit which should be checked</p>
</li></ul>
</li><li>
<p><strong>Fails</strong> :</p>
<ul><li>
<p>if limit is not an integer</p>
</li><li>
<p>if limit is smaller then -1</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>nil if there is no error</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="check_facet_limit-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 362</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">check_facet_limit</span>(<span class="ruby-identifier">limit</span>)
  <span class="ruby-identifier">fail</span> <span class="ruby-string">'InvalidArgumentException! limit must be an integer'</span> <span class="ruby-keyword">unless</span>
  <span class="ruby-identifier">limit</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Fixnum</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">limit</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Integer</span>)

  <span class="ruby-identifier">fail</span> <span class="ruby-string">'InvalidArgumentException! limit must be positive or -1
    for unlimited facets'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">limit</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">-1</span>

  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by</span><span
            class="method-args">(key, value)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>adds the filter passed to the api the given filter value</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>key</code> -&gt; the name of the filter which should be applied</p>
</li><li>
<p><code>value</code> -&gt; the value of the filter which should be applied</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 80</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-ivar">@filter</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by_category_ids" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by_category_ids</span><span
            class="method-args">(category_ids, append = false)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a filter for filtering by category ids</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>categoryIds</code> -&gt; the category ids used for filtering</p>
</li><li>
<p><code>append</code> -&gt; determines whether to append the category ids to
an already set value or not [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by_category_ids-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 137</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by_category_ids</span>(<span class="ruby-identifier">category_ids</span>, <span class="ruby-identifier">append</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">category_ids</span> = <span class="ruby-identifier">filter</span>(<span class="ruby-constant">FILTER_CATEGORY_IDS</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">category_ids</span> <span class="ruby-keyword">if</span>
  <span class="ruby-identifier">append</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">filter</span>(<span class="ruby-constant">FILTER_CATEGORY_IDS</span>)

  <span class="ruby-identifier">category_ids</span> = <span class="ruby-identifier">category_ids</span>.<span class="ruby-identifier">uniq</span>

  <span class="ruby-identifier">filter_by</span>(<span class="ruby-constant">FILTER_CATEGORY_IDS</span>, <span class="ruby-identifier">category_ids</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by_facet_group" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by_facet_group</span><span
            class="method-args">(facet_group, append = false)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a filter for filtering by Facet-Group</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>facet_group</code> -&gt; Instance of <a
href="../Model/FacetGroup.html">AboutYou::SDK::Model::FacetGroup</a></p>
</li><li>
<p><code>append</code> -&gt; determines whether to append the category ids to
an already set value or not [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by_facet_group-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 182</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by_facet_group</span>(<span class="ruby-identifier">facet_group</span>, <span class="ruby-identifier">append</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">filter_by_facet_ids</span>(<span class="ruby-identifier">facet_group</span>.<span class="ruby-identifier">ids</span>, <span class="ruby-identifier">append</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by_facet_group_set" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by_facet_group_set</span><span
            class="method-args">(facet_group_set, append = false)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a filter for filtering by Facet-Groupset</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>facet_group_set</code> -&gt; Instance of <a
href="../Model/FacetGroupSet.html">AboutYou::SDK::Model::FacetGroupSet</a></p>
</li><li>
<p><code>append</code> -&gt; determines whether to append the category ids to
an already set value or not [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by_facet_group_set-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 196</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by_facet_group_set</span>(<span class="ruby-identifier">facet_group_set</span>, <span class="ruby-identifier">append</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">filter_by_facet_ids</span>(<span class="ruby-identifier">facet_group_set</span>.<span class="ruby-identifier">ids</span>, <span class="ruby-identifier">append</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by_facet_ids" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by_facet_ids</span><span
            class="method-args">(attributes, append = false)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a filter for filtering by category ids</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>attributes</code> -&gt; Array of Hashes containing the relation
Group_Id =&gt; Array of Facet_Ids</p>
</li><li>
<p><code>append</code> -&gt; determines whether to append the category ids to
an already set value or not [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by_facet_ids-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 156</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by_facet_ids</span>(<span class="ruby-identifier">attributes</span>, <span class="ruby-identifier">append</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">merged</span> = <span class="ruby-identifier">attributes</span>[<span class="ruby-value">0</span>]
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">append</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">filter</span>(<span class="ruby-constant">FILTER_ATTRIBUTES</span>)
    <span class="ruby-identifier">merged</span> = <span class="ruby-identifier">filter</span>(<span class="ruby-constant">FILTER_ATTRIBUTES</span>)
    <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">group_id</span>, <span class="ruby-identifier">facet_ids</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">merged</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">group_id</span>)
        <span class="ruby-identifier">merged</span>[<span class="ruby-identifier">group_id</span>] = (<span class="ruby-identifier">merged</span>[<span class="ruby-identifier">group_id</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">facet_ids</span>).<span class="ruby-identifier">uniq</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">merged</span>[<span class="ruby-identifier">group_id</span>] = <span class="ruby-identifier">facet_ids</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">filter_by</span>(<span class="ruby-constant">FILTER_ATTRIBUTES</span>, <span class="ruby-identifier">merged</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by_price_range" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by_price_range</span><span
            class="method-args">(from = 0, to = 0)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a filter for filtering by Price range</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>from</code> -&gt; states the starting value of the price filter</p>
</li><li>
<p><code>to</code> -&gt; states the end value of the price filter</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by_price_range-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 210</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by_price_range</span>(<span class="ruby-identifier">from</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">to</span> = <span class="ruby-value">0</span>)
  <span class="ruby-identifier">from</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">from</span>)
  <span class="ruby-identifier">to</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">to</span>)
  <span class="ruby-identifier">price</span> = {}

  <span class="ruby-identifier">price</span>[<span class="ruby-string">'from'</span>] = <span class="ruby-identifier">from</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">from</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
  <span class="ruby-identifier">price</span>[<span class="ruby-string">'to'</span>] = <span class="ruby-identifier">to</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">to</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>

  <span class="ruby-identifier">filter_by</span>(<span class="ruby-constant">FILTER_PRICE</span>, <span class="ruby-identifier">price</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by_sale" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by_sale</span><span
            class="method-args">(sale = true)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a filter for filtering by sale</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>sale</code> -&gt; determines whether to filter by sale or not
[optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by_sale-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 108</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by_sale</span>(<span class="ruby-identifier">sale</span> = <span class="ruby-keyword">true</span>)
  <span class="ruby-identifier">sale</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">sale</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">TrueClass</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">sale</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">FalseClass</span>)

  <span class="ruby-identifier">filter_by</span>(<span class="ruby-constant">FILTER_SALE</span>, <span class="ruby-identifier">sale</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-filter_by_searchword" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">filter_by_searchword</span><span
            class="method-args">(searchword)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a filter for filtering by a searchword</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>searchword</code> -&gt; the searchword which should be used for
filtering</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="filter_by_searchword-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 123</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">filter_by_searchword</span>(<span class="ruby-identifier">searchword</span>)
  <span class="ruby-identifier">filter_by</span>(<span class="ruby-constant">FILTER_SEARCHWORD</span>, <span class="ruby-identifier">searchword</span>)
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-requires_categories" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">requires_categories</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method decides whether categories are required to fetch from api</p>
<ul><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>a boolean stating whether to fetch categories from api or not</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="requires_categories-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 437</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">requires_categories</span>
  (<span class="ruby-identifier">result</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">'fields'</span>) <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-constant">AboutYou</span><span class="ruby-operator">::</span><span class="ruby-constant">SDK</span><span class="ruby-operator">::</span><span class="ruby-constant">Criteria</span><span class="ruby-operator">::</span><span class="ruby-constant">ProductFields</span>.<span class="ruby-identifier">requires_categories</span>(
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'fields'</span>]
  )) <span class="ruby-operator">||</span> (
    <span class="ruby-identifier">result</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">'categories'</span>) <span class="ruby-operator">&amp;&amp;</span>
      <span class="ruby-identifier">result</span>[<span class="ruby-string">'categories'</span>]
    )
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-requires_facets" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">requires_facets</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method decides whether facets are required to fetch from api</p>
<ul><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>a boolean stating whether to fetch facets from api or not</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="requires_facets-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 453</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">requires_facets</span>
  (<span class="ruby-identifier">result</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">'fields'</span>) <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-constant">AboutYou</span><span class="ruby-operator">::</span><span class="ruby-constant">SDK</span><span class="ruby-operator">::</span><span class="ruby-constant">Criteria</span><span class="ruby-operator">::</span><span class="ruby-constant">ProductFields</span>.<span class="ruby-identifier">requires_facets</span>(
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'fields'</span>]
  )) <span class="ruby-operator">||</span> (
    <span class="ruby-identifier">result</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">'facets'</span>) <span class="ruby-operator">&amp;&amp;</span>
      <span class="ruby-operator">!</span><span class="ruby-identifier">result</span>[<span class="ruby-string">'facets'</span>].<span class="ruby-identifier">empty?</span>
    )
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-select_all_facets" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">select_all_facets</span><span
            class="method-args">(limit)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method will make the api return all facets</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>limit</code> -&gt; limits the received facets</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="select_all_facets-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 338</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select_all_facets</span>(<span class="ruby-identifier">limit</span>)
  <span class="ruby-identifier">check_facet_limit</span>(<span class="ruby-identifier">limit</span>)
  <span class="ruby-identifier">result</span>[<span class="ruby-string">'facets'</span>] = {
    <span class="ruby-constant">FACETS_ALL</span> =<span class="ruby-operator">&gt;</span> {
      <span class="ruby-string">'limit'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">limit</span>
    }
  }

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-select_categories" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">select_categories</span><span
            class="method-args">(enable = true)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method lets the api return the categories if stated so</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>enable</code> -&gt; determines whether or not the categories should
be received from the api [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="select_categories-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 381</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select_categories</span>(<span class="ruby-identifier">enable</span> = <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">enable</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'categories'</span>] = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'categories'</span>] = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-select_facets_by_group_id" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">select_facets_by_group_id</span><span
            class="method-args">(group_id, limit)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method adds a field to the api-request which enables you to receive
Facets by a given group id</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>group_id</code> -&gt; group id which facets you want to receive</p>
</li><li>
<p><code>limit</code> -&gt; limits the received facets</p>
</li></ul>
</li><li>
<p><strong>Fails</strong> :</p>
<ul><li>
<p>if group_id is not convertable in an Integer</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="select_facets_by_group_id-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 312</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select_facets_by_group_id</span>(<span class="ruby-identifier">group_id</span>, <span class="ruby-identifier">limit</span>)
  <span class="ruby-identifier">check_facet_limit</span>(<span class="ruby-identifier">limit</span>)

  <span class="ruby-identifier">fail</span> <span class="ruby-string">&quot;InvalidArgumentException! Group id must be an integer or a
  string containing digits&quot;</span> <span class="ruby-keyword">unless</span>
  <span class="ruby-identifier">group_id</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Fixnum</span>) <span class="ruby-operator">||</span> <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">group_id</span>)

  <span class="ruby-identifier">result</span>[<span class="ruby-string">'facets'</span>] = {} <span class="ruby-keyword">unless</span> <span class="ruby-identifier">result</span>[<span class="ruby-string">'facets'</span>]

  <span class="ruby-identifier">result</span>[<span class="ruby-string">'facets'</span>][<span class="ruby-constant">String</span>(<span class="ruby-identifier">group_id</span>)] = {
    <span class="ruby-string">'limit'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">limit</span>
  } <span class="ruby-keyword">unless</span>
  <span class="ruby-identifier">result</span>[<span class="ruby-string">'facets'</span>][<span class="ruby-identifier">group_id</span>]

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-select_price_ranges" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">select_price_ranges</span><span
            class="method-args">(enable = true)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method determines whether you receive price ranges or not</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>enable</code> -&gt; if true api will return price ranges [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="select_price_ranges-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 288</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select_price_ranges</span>(<span class="ruby-identifier">enable</span> = <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">enable</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'price'</span>] = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'price'</span>] = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-select_product_fields" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">select_product_fields</span><span
            class="method-args">(fields)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method lets you select certain <a
href="ProductFields.html">AboutYou::SDK::Criteria::ProductFields</a> which
will be returned from api</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>fields</code> -&gt; an Array of constants from <a
href="ProductFields.html">AboutYou::SDK::Criteria::ProductFields</a></p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="select_product_fields-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 424</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select_product_fields</span>(<span class="ruby-identifier">fields</span>)
  <span class="ruby-identifier">result</span>[<span class="ruby-string">'fields'</span>] =
    <span class="ruby-constant">AboutYou</span><span class="ruby-operator">::</span><span class="ruby-constant">SDK</span><span class="ruby-operator">::</span><span class="ruby-constant">Criteria</span><span class="ruby-operator">::</span><span class="ruby-constant">ProductFields</span>.<span class="ruby-identifier">filter_fields</span>(<span class="ruby-identifier">fields</span>)

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-select_sales" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">select_sales</span><span
            class="method-args">(enable = true)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method determines whether you receive only sales products or not</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>enable</code> -&gt; if true api will return only sales products
[optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="select_sales-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 269</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select_sales</span>(<span class="ruby-identifier">enable</span> = <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">enable</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'sale'</span>] = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-string">'sale'</span>] = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-set_limit" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">set_limit</span><span
            class="method-args">(limit, offset = 0)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a limit and offset for the product search</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>limit</code> -&gt; limits the amount of results received from the api</p>
</li><li>
<p><code>offset</code> -&gt; sets an offset to skip results [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="set_limit-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 250</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_limit</span>(<span class="ruby-identifier">limit</span>, <span class="ruby-identifier">offset</span> = <span class="ruby-value">0</span>)
  <span class="ruby-identifier">limit</span> = [[<span class="ruby-identifier">limit</span>, <span class="ruby-value">200</span>].<span class="ruby-identifier">min</span>, <span class="ruby-value">0</span>].<span class="ruby-identifier">max</span>
  <span class="ruby-identifier">result</span>[<span class="ruby-string">'limit'</span>] = <span class="ruby-identifier">limit</span>

  <span class="ruby-identifier">offset</span> = [<span class="ruby-identifier">offset</span>, <span class="ruby-value">0</span>].<span class="ruby-identifier">max</span>
  <span class="ruby-identifier">result</span>[<span class="ruby-string">'offset'</span>] = <span class="ruby-identifier">offset</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-sort_by" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">sort_by</span><span
            class="method-args">(type, direction = SORT_ASC)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>sets a sorting-filter and direction</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>type</code> -&gt; states the type of the sorting</p>
</li><li>
<p><code>direction</code> -&gt; the direction of the sorting [optional]</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a
href="ProductSearchCriteria.html">AboutYou::SDK::Criteria::ProductSearchCriteria</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="sort_by-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 231</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sort_by</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">direction</span> = <span class="ruby-constant">SORT_ASC</span>)
  <span class="ruby-identifier">result</span>[<span class="ruby-string">'sort'</span>] = {
    <span class="ruby-string">'by'</span>        =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>,
    <span class="ruby-string">'direction'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">direction</span>
  }

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-to_array" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">to_array</span><span
            class="method-args">()</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>this method turns an instance of
AboutYou::SDK::Criteria::product_search_criteria in an Array which can be
passed directly to the api</p>
<ul><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an Array containing all the parameters set on the instance</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="to_array-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Criteria/product_search_criteria.rb, line 471</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_array</span>
  <span class="ruby-identifier">params</span> = {
    <span class="ruby-string">'session_id'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">session_id</span>
  }

  <span class="ruby-identifier">params</span>[<span class="ruby-string">'result'</span>] = <span class="ruby-identifier">result</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>
  <span class="ruby-identifier">params</span>[<span class="ruby-string">'filter'</span>] = <span class="ruby-ivar">@filter</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@filter</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-identifier">params</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
  </section>
</main>


<footer id="validator-badges" role="contentinfo">
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>

